package com.jerome.fs.http;

import java.util.HashMap;
import java.util.Map;

/**
 * HTTP Response object.
 * Represents an HTTP response with attributes including version, status code, status description, headers, and message body.
 *
 * @author Jerome
 * @date 2023/8/5
 */
public class Response {
    /**
     * HTTP version.
     */
    private String version;

    /**
     * HTTP status code.
     */
    private int code;

    /**
     * HTTP status description.
     */
    private String status;

    /**
     * Response headers.
     */
    private Map<String, String> headers = new HashMap<>();

    /**
     * Response message body.
     */
    private String message;

    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public Map<String, String> getHeaders() {
        return headers;
    }

    public void setHeaders(Map<String, String> headers) {
        this.headers = headers;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    @Override
    public String toString() {
        return "Response{" +
                "version='" + version + '\'' +
                ", code=" + code +
                ", status='" + status + '\'' +
                ", headers=" + headers +
                ", message='" + message + '\'' +
                '}';
    }
}
